package com.xmy.study.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author Coly
 * @since 2023-06-29
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("per_student_account")
public class StudentAccount implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @ExcelIgnore
    private Long id;

    @ExcelIgnore
    @ApiModelProperty("学校编号")
    private Long schoolId;

    @ExcelIgnore
    @ApiModelProperty("学生编号")
    private Long studentId;

    @ExcelProperty(value = "姓名")
    @ApiModelProperty("学生名字")
    private String studentName;

    @ApiModelProperty("学生昵称")
    @TableField(exist = false)
    private String nickName;

    @ExcelIgnore
    @ApiModelProperty("0：禁用 1：正常 2：试用")
    private Integer status;

    @ExcelProperty(value = "账号")
    @ApiModelProperty("账户")
    private String account;

    @ExcelProperty(value = "密码")
    @ApiModelProperty("密码")
    private String pwd;

    @ExcelIgnore
    @ApiModelProperty("年份")
    private Integer yearPart;

    @ExcelIgnore
    @ApiModelProperty("学期")
    private Integer quarterNum;

    /*@ExcelIgnore
    @ApiModelProperty("学期分类：1根据本次课任务安排进行训练；2统一从第一关开始")
    @TableField(exist = false)
    private Integer quarterType;*/

    @ExcelIgnore
    @ApiModelProperty("年级id")
    private Integer yearClassId;

    @ExcelIgnore
    @ApiModelProperty("年级名称")
    @TableField(exist = false)
    private String yearClassName;

    @ExcelIgnore
    @ApiModelProperty("1：学生 2：教师")
    private Integer accountType;

    @ExcelIgnore
    @ApiModelProperty("班型id")
    private Long classTypeId;

    @ExcelIgnore
    @ApiModelProperty("1精品课学生自动生成 2手动添加")
    private Integer addType;

    @ExcelIgnore
    @ApiModelProperty("是否删除，0正常，1删除")
    @TableLogic(value = "0", delval = "1")
    @TableField(select = false)
    private Integer deleted;

    @ExcelProperty(value = "班型")
    @ApiModelProperty("班型")
    @TableField(exist = false)
    private String classTypeStr;

    @ExcelProperty(value = "年级")
    @ApiModelProperty("年级")
    @TableField(exist = false)
    private String classYearStr;

    @ApiModelProperty("精品课所在班级id")
    @TableField(select = false)
    @ExcelIgnore
    private Long gradeId;

    /**
     * 试用帐号的到期日期
     */
    @ExcelIgnore
    private LocalDate tryOutEndDate;

    @ExcelIgnore
    @ApiModelProperty("pk开关")
    private Integer switchPk;

    @ExcelProperty(value = "校区")
    @TableField(select = false)
    private String schoolStr;

    @ExcelIgnore
    @ApiModelProperty("是否收费，0否，1是")
    @TableField(exist = false)
    private Integer isCharge;

    @ExcelIgnore
    @ApiModelProperty("学习版本id")
    @TableField(exist = false)
    private Long courseVersionId;

    @ExcelIgnore
    @TableField(exist = false)
    private Integer isGoUp;

    @ExcelIgnore
    @ApiModelProperty("升班前 班型")
    private Long beforeClassTypeId;

    @ExcelIgnore
    @TableField(exist = false)
    private Integer isStudyLack;

    @ApiModelProperty("等级")
    @TableField(exist = false)
    private Integer level;

    @ExcelIgnore
    @ApiModelProperty("添加时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;
}
